#include<stdio.h>
int main()
{  
   int m,n,t,a,b;
    scanf("%d%d",&m,&n);
    a=m*n;

    while(m!=n)
    {
        if(m>n)
            m=m-n;
        else
            n=n-m;
      }
  
    b=a/m;
    printf("最大公约数是:%d",m);
    printf("\n最小公倍数是:%d",b);
    return 0;
}
